<template>
	<div @click="toConfigUrl">
		<van-notice-bar 
		:text="config.content" 
		:backgroundColor="config.backgroundColor" 
		:color="config.color"
		:left-icon="config.iconUrl"
		/>
	</div>
</template>

<script>
	export default {
		name: "announcement",
		props: {
			config: {
				type: Object,
				required: true
			}
		},
		methods: {
			// 跳转到配置的url
			toConfigUrl() {
				wx.navigateTo({
					url: this.config.href
				})
			}
		}
	};
</script>

<style scoped>
</style>
